<?php

/**
 * rmOutAvailable form base class.
 *
 * @method rmOutAvailable getObject() Returns the current form's model object
 *
 * @package    ressourceManager
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasermOutAvailableForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_out_available' => new sfWidgetFormInputHidden(),
      'id_out_type'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('idOutType'), 'add_empty' => false)),
      'id_user'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('idUser'), 'add_empty' => false)),
      'available'        => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id_out_available' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_out_available')), 'empty_value' => $this->getObject()->get('id_out_available'), 'required' => false)),
      'id_out_type'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('idOutType'))),
      'id_user'          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('idUser'))),
      'available'        => new sfValidatorNumber(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('rm_out_available[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'rmOutAvailable';
  }

}
